package com.wanshi.cloud.feign;

import com.wanshi.cloud.entity.Products;
import com.wanshi.cloud.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feign/product")
public class FeignProductController {
    @Autowired
    private IProductService productService;

    //根据id查商品
    @GetMapping("/{id}")
    public Products findById(@PathVariable Integer id){
        return productService.getById(id);
    }
}
